﻿using System.Collections.Generic;
using System.Linq;
using EYCmsAdmin.Domain.Models;
using EYCmsAdmin.Domain.Models.QueryModel;
using EYCmsAdmin.Domain.RepositoryInterfaces;
using NHibernate.Linq;
using NHibernate.Transform;

namespace EYCmsAdmin.NHibernate.Repository
{
    public class EducationInstitutionRepository : BaseRepository<EducationInstitution>, IEducationInstitutionRepository
    {
        public EducationInstitutionRepository(string sessionName) : base(sessionName)
        {
        }

        public Test Test()
        {
            StudyGroup x = null;
            EducationInstitution e = null;
            Test test = null;
/*            var s = NHibernateSession.QueryOver<StudyGroup>(() => x).JoinAlias(m => m.EducationInstitution, () => e)
                .Where(w => w.Id == 1)
                .SelectList(list => list
                            .Select(q => q.Id).WithAlias(() => test.StudyGroup.Id)
                            )
                .TransformUsing(Transformers.AliasToBean<Test>()).List<Test>();*/
            return new Test();
        }
    }
}